import { get } from '@/utils/http'

/**
 * 获取菜谱首页幻灯片数量
 * @returns Promise<{id,img,title}>
 */
export const getHomeSwiperApi = async () => {
  let ret = await get('/api/swiper')
  ret.data = ret.data.map(item => ({
    ...item,
    to: `/detail/${item.id}`
  }))
  return ret
}

// 获取热门分类
export const getHotCateApi = () => get('/api/hotcate')

// 获取精品好菜
export const getGoodFoodApi = (page = 1) => get('/api/goodfood?page=' + page)